package com.yzw.controller;

import com.yzw.service.AsyncService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


/**
 * @author yzw
 * @date 2022/8/24 20:30
 * @desc 异步测试请求
 */
@RestController
public class AsyncController {

    @Resource
    private AsyncService asyncService;

    @GetMapping("/test1")
    public String test(){
        return "success";
    }

    @PostMapping("/request")
    public String requestMethod(@RequestBody PostBody body){
        asyncService.post(body);
        return "成功";
    }
}
